import request from '../request'

const common_api = '/api/adminproject'

const Api = {
  page: `${common_api}/project/page`,
  remove: `${common_api}/project/remove`,
  save: `${common_api}/project/save`,
  selectById: `${common_api}/project/selectById`,
  update: `${common_api}/project/update`
}

/** 查询项目列表 */
export const page = params => {
  return request.request({
    url: Api.page,
    params,
    method: 'GET'
  })
}

/** 删除项目 */
export const remove = params => {
  return request.request({
    url: Api.remove,
    params,
    method: 'DELETE'
  })
}

/** 新增项目 */
export const save = data => {
  return request.request({
    url: Api.save,
    data,
    method: 'POST'
  })
}

/** 查询项目详情 */
export const selectById = params => {
  return request.request({
    url: Api.selectById,
    params,
    method: 'GET'
  })
}

/** 编辑项目详情 */
export const update = data => {
  return request.request({
    url: Api.update,
    data,
    method: 'PUT'
  })
}
